
import 'dart:io';

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/services.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpBaseConst.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpKCBaseConst.dart';
import 'package:flutter_ahj_app/base/cunchu/UserInfoUtils.dart';
import 'package:flutter_ahj_app/base/utils/ToastUtils.dart';

const MethodChannel _kChannel = MethodChannel('com.ahj/LoginPlugin');
class LoginUtils{
  /**
   * 一键登录
   */
  static Future<String>  YijianDengluZhibo() async {
    Map<String, dynamic> map = Map();

    try {
      var result = await(new Connectivity().checkConnectivity());
      if (result==ConnectivityResult.none) {
        ToastUtils.showToast("网络连接失败");
      }else{
        return  await _kChannel.invokeMethod('yijiandenglu', map);
      }
    } on SocketException catch (_) {

    }



  }


}